USE [AmazonMWS]
GO

/****** Object:  Table [con].[AdRelease]    Script Date: 11/06/2015 18:41:09 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [con].[AdRelease](
	[AdReleaseID] [int] IDENTITY(1,1) NOT NULL,
	[SiteId] [int] NOT NULL,
	[AccountInfoId] [int] NOT NULL,
	[AmazonItemOperationId] [nvarchar](50) NOT NULL,
	[SKU] [nvarchar](50) NOT NULL,
	[ASIN] [nvarchar](50) NULL,
	[Price] [decimal](18, 2) NULL,
	[Inventory] [int] NULL,
	[ProductInfoModel] [nvarchar](max) NULL,
	[IsUpdateProduct] [bit] NULL,
	[ProductRelationshipModel] [nvarchar](max) NULL,
	[IsUpdateRelationship] [bit] NULL,
	[ProductImageModel] [nvarchar](max) NULL,
	[IsUpdateImage] [bit] NULL,
	[ProductPriceModel] [nvarchar](max) NULL,
	[IsUpdatePrice] [bit] NULL,
	[ProductInventoryModel] [nvarchar](max) NULL,
	[IsUpdateInventory] [bit] NULL,
	[IsRelease] [bit] NOT NULL,
	[Levels] [int] NULL,
	[StartTime] [datetime] NULL,
	[EndTime] [datetime] NULL,
	[ApiOperationType] [nvarchar](20) NULL,
	[ApiOperationStatus] [nvarchar](20) NULL,
	[ApiOperationRemark] [nvarchar](500) NULL,
	[IsDel] [bit] NULL,
	[CreateUser] [nvarchar](20) NULL,
	[CreateTime] [datetime] NULL,
	[UpdateUser] [nvarchar](20) NULL,
	[UpdateTime] [datetime] NULL,
 CONSTRAINT [PK__AdReleas__8AA77A42681373AD] PRIMARY KEY CLUSTERED 
(
	[AdReleaseID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF_AdRelease_IsUpdateProduct]  DEFAULT ((0)) FOR [IsUpdateProduct]
GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF_AdRelease_IsUpdateRelationship]  DEFAULT ((0)) FOR [IsUpdateRelationship]
GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF_AdRelease_IsUpdateImage]  DEFAULT ((0)) FOR [IsUpdateImage]
GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF_AdRelease_IsUpdatePrice]  DEFAULT ((0)) FOR [IsUpdatePrice]
GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF_AdRelease_IsUpdateInventory]  DEFAULT ((0)) FOR [IsUpdateInventory]
GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF_AdRelease_IsRelease]  DEFAULT ((0)) FOR [IsRelease]
GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF__AdRelease__Level__69FBBC1F]  DEFAULT ((0)) FOR [Levels]
GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF__AdRelease__IsDel__6AEFE058]  DEFAULT ((0)) FOR [IsDel]
GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF__AdRelease__Creat__6BE40491]  DEFAULT ('Pu') FOR [CreateUser]
GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF__AdRelease__Creat__6CD828CA]  DEFAULT (getdate()) FOR [CreateTime]
GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF__AdRelease__Updat__6DCC4D03]  DEFAULT ('FL') FOR [UpdateUser]
GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF__AdRelease__Updat__6EC0713C]  DEFAULT (getdate()) FOR [UpdateTime]
GO


